﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;

namespace Components.Data.UI.Controls.ControlBuilders
{
  class UserControlBuilder : IControlBuilder
  {
    #region IControlBuilder Members

    public System.Web.UI.Control Build(ControlBindingArgs args)
    {
      String virtualPath = args["VirtualPath"];
      Page page = new Page();
      UserControl userControl = (UserControl)page.LoadControl(virtualPath);
      return userControl;
    }

    #endregion
  }
}